#ifndef _CARD_H_
#define _CARD_H_

/**
 * @file   Card.h
 * @author Jinsong Du <jdu@linuxdu.gfed.net>
 * @date   Mon Jul 28 10:16:30 2008
 * 
 * @brief  Card class
 * 
 * Represent a normal playing card.
 */

class Card
{
public:
    /** 
     * Enumeration of suit type
     * 
     */
    enum SuitType {SPADES = 0, HEARTS, CLUBS, DIAMONDS, JOKER = 52};
    
    enum NumberType {ACE = 1, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING};
private:
    const static char START_CHAR = 'A';

    //  1 - 13  Spade     ace - King
    // 14 - 26  Hearts    Ace - King
    // 27 - 39  Clubs     Ace - King
    // 40 - 52  Diamonds  Ace - King
    // 53       Joker
    int card;
    int suit;
    int number;
public:
    /** 
     * Default constructor
     * 
     */
    Card();
    /** 
     * Constructor
     * 
     * @param card is int with value as:
     *         1 - 13  Spade     ace - King
     *        14 - 26  Hearts    Ace - King
     *        27 - 39  Clubs     Ace - King
     *        40 - 52  Diamonds  Ace - King
     *        53       Joker
     */
    Card(int card);
    /** 
     * Get ths suit number of this card
     * 
     * @return int as suit number: SPADES = 0, HEARTS = 1, CLUBS = 2, DIAMONDS = 3, JOKER = 52
     */
    int getSuit() const;
    /** 
     * 
     * Get ths card number
     * 
     * @return int as card number: ACE=1, ...., JACK=11, QUEEN=12, KING=13, JOKER=52
     */
    int getNumber() const;
    /** 
     * Get card value, ACE as 11; 2,...,10 as their card number; JACK,QUEEN,KING as 10
     * 
     * @return int as card value used in games like Black Jack.
     */
    int getValue() const;
    /** 
     * Check if this card is an ACE.
     * 
     * @return bool, true is ACE, false is not ACE.
     */
    bool isAce() const;
    /** 
     * Get the char to represent this card.
     * TODO-- Add the list of card representation
     * 
     * @return char that represents this card.
     */
    char toChar() const;
//     void setChar(char ch);
//     int getCardNum();
    /** 
     * Set this card to the int(card)
     * @see Card(int card)
     * @param card 
     */
    void setCard(int card);
private:
    /** 
     * 
     * 
     * @param card 
     */
    void setData(int card);
};

#endif  // _CARD_H_
